//Replication File - LA Survey 

use "/Users/nathankalmoe/Dropbox/Research/Old Other/PPRL/CommunityResilienceData Coded.dta", clear
set more off

gen ageyrs=2016-age

gen newscred=sb2
recode newscred 1=1 2=.5 3 999 888=0 4=-.5 5=-1 else=.

*Table 2
*Support protest (1=justified, 2=unjustified, 888=DK, 999=refused)
tab r13 [aw=weight_metro], miss
tab r13 [aw=weight_state] if weight_metro==., miss

*Police force on protesters (1=right amount, 2=use more, 3=use less, 888=DK, 999=refused)
tab r14 [aw=weight_metro], miss
tab r14 [aw=weight_state] if weight_metro==., miss

*Racial equality (1=reached equality, 2=do more, 3=too far, 888=DK, 999=refused)
tab r2 [aw=weight_metro], miss
tab r2 [aw=weight_state] if weight_metro==., miss

*News credibility (1/2=def/prob yes, 3=maybe, 4/5=prob/def not, 888=DK, 999=refused)
tab sb2 [aw=weight_metro], miss
tab sb2 [aw=weight_state] if weight_metro==., miss

*Table 3
tab protestOK [aw=weight_metro] if white==1 & protestOK~=.5
tab protestOK [aw=weight_metro] if black==1 & protestOK~=.5

tab polforce [aw=weight_metro] if white==1
tab polforce [aw=weight_metro] if black==1

tab blkequal [aw=weight_metro] if white==1
tab blkequal [aw=weight_metro] if black==1

tab newscred [aw=weight_metro] if white==1 
tab newscred [aw=weight_metro] if black==1

*Appendix analysis on survey demographics
tab black [aw=weight_state] if weight_metro==.
tab black [aw=weight_metro] 
tab white [aw=weight_state] if weight_metro==.
tab white [aw=weight_metro] 
tab fem [aw=weight_state] if weight_metro==.
tab fem [aw=weight_metro] 
tab ageyrs [aw=weight_state] if weight_metro==.
tab ageyrs [aw=weight_metro] 
*1=college grad
tab edu4 [aw=weight_state] if weight_metro==.
tab edu4 [aw=weight_metro] 
*1-4 is <35k, 5-7 <100k, 
tab income [aw=weight_state] if weight_metro==. & income<=10
tab income [aw=weight_metro] if income<=10

